3.1.72 \(\int \frac {(a+b x) (A+B x)}{x^2} \, dx\)

Optimal. Leaf size=22 \[ \log (x) (a B+A b)-\frac {a A}{x}+b B x \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {76} \begin {gather*} \log (x) (a B+A b)-\frac {a A}{x}+b B x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin {align*} \int \frac {(a+b x) (A+B x)}{x^2} \, dx &=\int \left (b B+\frac {a A}{x^2}+\frac {A b+a B}{x}\right ) \, dx\\ &=-\frac {a A}{x}+b B x+(A b+a B) \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 22, normalized size = 1.00 \begin {gather*} \log (x) (a B+A b)-\frac {a A}{x}+b B x \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)*(A + B*x))/x^2,x]

[Out]

-((a*A)/x) + b*B*x + (A*b + a*B)*Log[x]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(a+b x) (A+B x)}{x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[((a + b*x)*(A + B*x))/x^2,x]

[Out]

IntegrateAlgebraic[((a + b*x)*(A + B*x))/x^2, x]

________________________________________________________________________________________

fricas [A]  time = 1.26, size = 26, normalized size = 1.18 \begin {gather*} \frac {B b x^{2} + {\left (B a + A b\right )} x \log \relax (x) - A a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="fricas")

[Out]

(B*b*x^2 + (B*a + A*b)*x*log(x) - A*a)/x

________________________________________________________________________________________

giac [A]  time = 1.25, size = 23, normalized size = 1.05 \begin {gather*} B b x + {\left (B a + A b\right )} \log \left ({\left | x \right |}\right ) - \frac {A a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="giac")

[Out]

B*b*x + (B*a + A*b)*log(abs(x)) - A*a/x

________________________________________________________________________________________

maple [A]  time = 0.01, size = 23, normalized size = 1.05 \begin {gather*} A b \ln \relax (x )+B a \ln \relax (x )+B b x -\frac {A a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(B*x+A)/x^2,x)

[Out]

b*B*x-a*A/x+A*ln(x)*b+B*ln(x)*a

________________________________________________________________________________________

maxima [A]  time = 1.10, size = 22, normalized size = 1.00 \begin {gather*} B b x + {\left (B a + A b\right )} \log \relax (x) - \frac {A a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x^2,x, algorithm="maxima")

[Out]

B*b*x + (B*a + A*b)*log(x) - A*a/x

________________________________________________________________________________________

mupad [B]  time = 0.30, size = 22, normalized size = 1.00 \begin {gather*} \ln \relax (x)\,\left (A\,b+B\,a\right )+B\,b\,x-\frac {A\,a}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x))/x^2,x)

[Out]

log(x)*(A*b + B*a) + B*b*x - (A*a)/x

________________________________________________________________________________________

sympy [A]  time = 0.24, size = 19, normalized size = 0.86 \begin {gather*} - \frac {A a}{x} + B b x + \left (A b + B a\right ) \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x**2,x)

[Out]

-A*a/x + B*b*x + (A*b + B*a)*log(x)

________________________________________________________________________________________